package com.luych.toolbox.common.feign.view.docker.service;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;
import java.util.List;

@ApiModel("镜像数据返回")
public class DockerImageView {

    @ApiModelProperty("名称")
    private String name;
    @ApiModelProperty("标签")
    private String tag;
    @ApiModelProperty("镜像ID")
    private String id;
    @ApiModelProperty("创建时间")
    private Date created;
    @ApiModelProperty("大小")
    private String size;
    @ApiModelProperty("环境变量")
    private List<String> env;
    @ApiModelProperty("Cmd")
    private List<String> cmd;
    @ApiModelProperty("Entrypoint")
    private List<String> entrypoint;
    @ApiModelProperty("操作系统")
    private String os;
    @ApiModelProperty("CPU架构")
    private String architecture;
    @ApiModelProperty("历史")
    private List<DockerImageHistoryView> histories;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getNameTag() {
        return this.name + ":" + this.tag;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public List<String> getEnv() {
        return env;
    }

    public String getEnvContent() {
        return env == null ? "" : String.join("\r\n", env);
    }

    public void setEnv(List<String> env) {
        this.env = env;
    }

    public List<String> getCmd() {
        return cmd;
    }

    public String getCmdContent() {
        return cmd == null ? "" : String.join("\r\n", cmd);
    }

    public void setCmd(List<String> cmd) {
        this.cmd = cmd;
    }

    public List<String> getEntrypoint() {
        return entrypoint;
    }

    public String getEntrypointContent() {
        return entrypoint == null ? "" : String.join("\r\n", entrypoint);
    }

    public void setEntrypoint(List<String> entrypoint) {
        this.entrypoint = entrypoint;
    }

    public String getOs() {
        return os;
    }

    public void setOs(String os) {
        this.os = os;
    }

    public String getArchitecture() {
        return architecture;
    }

    public void setArchitecture(String architecture) {
        this.architecture = architecture;
    }

    public List<DockerImageHistoryView> getHistories() {
        return histories;
    }

    public void setHistories(List<DockerImageHistoryView> histories) {
        this.histories = histories;
    }
}
